import axios from 'axios';
import { fromJS } from 'immutable';
import * as constant from "./actionTypes.js";


const changeList = (data) => ({
	type:constant.CHANGE_LIST,
	data:fromJS(data)
})

export const getFocusedValue = (value) => ({
	type:constant.NAV_SEARCH_INPUT,
	value
});


export const getList = () => {
	return (dispatch) => {
		axios.get('/api/headerList.json').then( (res) => {
		 	dispatch(changeList(res.data.data));
		}).catch(() => {
			console.log('error');
		});
	}
}
